var log4js = require('log4js');

log4js.configure({
    appenders: [
        { type: 'console' }, //控制台输出
        {
            type: 'file', //文件输出
            filename: './logModel/logFiles/access.log',
            maxLogSize: 1024 * 1024 * 100,
            backups: 3,
            category: 'normal'
        }
    ],
    replaceConsole: true
});
var logger = log4js.getLogger('normal');
logger.setLevel('INFO');


exports.logWithTrace = function (message) {
    logger.trace(message);
}
exports.logWithDebug = function (message) {
    logger.debug(message);
}
exports.logWithInfo = function (message) {
    logger.info(message);
}
exports.log = function (message) {// 快捷方式，默认info
    logger.info(message);
}
exports.logWithWarn = function (message) {
    logger.warn(message);
}
exports.logWithError = function (message) {
    logger.error(message);
}
exports.logWithFatal = function (message) {
    logger.fatal(message);
}
